home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name pcexit -- Terminate the process and set the exit code
- *
- * Synopsis pcexit(excode);
- * unsigned excode Exit code to set
- *
- * Description This function terminates the current process an sets
- * the exit code. The exit code can be inspected by the
- * parent process using the PCWAIT function, or at the
- * DOS level by using the ERRORLEVEL batch command.
- * Notice that the exit code can be no greater than 255
- * or less than 0.
- *
- * Version 1.1 (C)Copyright Blaise Computing Inc. 1983, 1984
- *
- **/
- #define utbyword(a,b) (((a)<<8)|((b)&0x00ff)) /* a is high, b low */
-
- struct dreg
- {
- unsigned ax,bx,cx,dx,si,di,ds,es;
- };
- #define DOSREG struct dreg
-
- int pcexit(excode)
- unsigned excode;
- {
- DOSREG dos_reg;
-
- utinit(&dos_reg);
- dos_reg.ax = utbyword(0x4c,excode);
-
- return(dos(&dos_reg));
-
- }